package xhwl.hmo.mall.http.api;


import com.google.gson.Gson;

import okhttp3.RequestBody;
import rx.Observable;
import xhwl.hmo.mall.http.ApiService;
import xhwl.retrofitrx.BaseApi;

/**
 * Created by admin on 2017/1/16.
 */

public class UpdateUserInfoApi extends BaseApi {
    UpdateUserInfoReq req;
    public UpdateUserInfoApi(String member_mobile, String member_name,String member_pic){
        req=new UpdateUserInfoReq(member_mobile,member_name,member_pic);
        setShowDialog(true);
    }

    @Override
    protected Observable getObservable() {
        RequestBody requestBody = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), new Gson().toJson(req));
        return retrofit.create(ApiService.class).updateUserInfo(requestBody);
    }
    public class UpdateUserInfoReq {
        private String member_mobile;
        private String member_name;
        private String member_pic;

        public UpdateUserInfoReq(String member_mobile, String member_name,String member_pic) {
            this.member_mobile = member_mobile;
            this.member_name=member_name;
            this.member_pic=member_pic;
        }
    }
}
